target: app

include $(SOURCE_HOME)/makeconf

OBJ_PATH 	= .
BIN_OUTPUT 	= $(BIN_OUTPUT_PATH)/webserver$(BIN_EXTNAME)

ALLSRC = $(wildcard *.c) $(wildcard *.cpp)
ALLOBJ = $(patsubst %.c, $(OBJ_PATH)/%.o, $(filter %.c, $(ALLSRC))) \
		 $(patsubst %.cpp, $(OBJ_PATH)/%.o, $(filter %.cpp, $(ALLSRC)))

INCPATH += $(INC_OPENSSL)
LIBLINK += $(LIB_OPENSSL)

$(OBJ_PATH)/%.o:%.cpp
	$(CPP) $(INCPATH) -c -o $@ $<

clean:
	@$(DELETEFILE) $(OBJ_PATH)/*.o

app: $(ALLOBJ)
	$(CPP) -o $(BIN_OUTPUT) $(ALLOBJ) -L$(LIB_OUTPUT_PATH) -lhttp -lzlib -ldbx.base $(LIBLINK)

gdb:
	@$(GDB) $(BIN_OUTPUT)

run:
	@$(BIN_OUTPUT) ../etc/config.lua -d -l